package day7;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * @author oldliu
 * @since 1.0
 */
public class Quizday {
    public static void main(String[] args) {
        Calendar c = Calendar.getInstance();
//        c.set(Calendar.YEAR,c.get(Calendar.YEAR));

        SimpleDateFormat s = new SimpleDateFormat("yyyy/MM/dd hh");
        for(int i=0;i<12;i++){
            c.set(Calendar.DAY_OF_MONTH,1);
            c.set(Calendar.MONTH,i);
            c.set(Calendar.YEAR,c.get(Calendar.YEAR));
            //每月最大周
            int i1 = c.getActualMaximum(Calendar.DAY_OF_MONTH);

            c.set(Calendar.DAY_OF_MONTH,i1);//去每个月的最后一天
            //System.out.println(s.format(c.getTime()));
            int day = c.get(Calendar.DAY_OF_WEEK)%7;
            c.roll(Calendar.DAY_OF_MONTH,-day-7);

            //c.roll(Calendar.DAY_OF_WEEK,Calendar.SATURDAY);
            //c.set(Calendar.DAY_OF_WEEK,Calendar.SATURDAY);
            //
            c.set(Calendar.HOUR_OF_DAY,8);
            Date time = c.getTime();
            String format = s.format(time);
            System.out.println(format);
            System.out.println(">>>>>>>>>>>>>>>>>>>");
        }

    }
}
